package org.stools.plugin.exception;

/**
 * 自定义插件核心异常类
 * 
 * @author chunliny
 * 
 */
public class PluginException extends Exception {

	private static final long serialVersionUID = 1L;

	/**错误编号 **/
	private String errorId;

	/**错误内容**/
	private String errorMessage;

    /**
     * 默认构造函数
     * @param ex 异常
     */
	public PluginException(Exception ex) {
		super(ex);
	}

    /**
     * 构造函数
     * @param errorId 错误ID
     * @param ex 异常
     */
	public PluginException(String errorId, Exception ex) {
		super(ex);
		this.errorId = errorId;
	}

    /**
     * 构造函数
     * @param errorId 错误ID
     */
	public PluginException(String errorId) {
		this.errorId = errorId;
	}

	/**
	 * 构造函数
	 * @param errorId 错误ID
	 * @param errorMessage 错误内容
	 */
	public PluginException(String errorId, String errorMessage) {
		this.errorId =errorId;
		this.errorMessage = errorMessage;
	}

	public String toString() {
		return "errorId:" + errorId + ",errorMessage:" + errorMessage;
	}

	public String getErrorId() {
		return errorId;
	}

	public void setErrorId(String errorId) {
		this.errorId = errorId;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
}
